class CreateAirways < ActiveRecord::Migration
  def self.up
    create_table :airways do |t|
      t.string :airways_name     ,:limit => 50
      t.string :airways_code     ,:limit => 6
      t.string :passenger_code   ,:limit => 6
      t.string :airways_type     ,:limit => 13
      t.integer :is_locked       ,:limit => 1 ,:default => 0 #是否管理会要锁定 1为True 0为False
      t.timestamps
    end
    
    add_index :airways, :airways_code ,:unique=>true
    
    Airways.create(:airways_name =>'山航',:airways_code=>'SC',:passenger_code=>'324',:airways_type=>'internal')
    Airways.create(:airways_name =>'国航',:airways_code=>'CA',:passenger_code=>'999',:airways_type=>'internal')
    Airways.create(:airways_name =>'东航',:airways_code=>'MU',:passenger_code=>'781',:airways_type=>'internal')
    Airways.create(:airways_name =>'南航',:airways_code=>'CZ',:passenger_code=>'784',:airways_type=>'internal')
    Airways.create(:airways_name =>'上航',:airways_code=>'FM',:passenger_code=>'774',:airways_type=>'internal')
    Airways.create(:airways_name =>'厦航',:airways_code=>'MF',:passenger_code=>'731',:airways_type=>'internal')
    Airways.create(:airways_name =>'深航',:airways_code=>'ZH',:passenger_code=>'479',:airways_type=>'internal')
    Airways.create(:airways_name =>'海航',:airways_code=>'HU',:passenger_code=>'880',:airways_type=>'internal')
    Airways.create(:airways_name =>'川航',:airways_code=>'3U',:passenger_code=>'876',:airways_type=>'internal')
    Airways.create(:airways_name =>'吉祥',:airways_code=>'HO',:passenger_code=>'018',:airways_type=>'internal')
    Airways.create(:airways_name =>'奥凯',:airways_code=>'BK',:passenger_code=>'866',:airways_type=>'internal')
    Airways.create(:airways_name =>'中联',:airways_code=>'KN',:passenger_code=>'822',:airways_type=>'internal')
    Airways.create(:airways_name =>'东星',:airways_code=>'8C',:passenger_code=>'883',:airways_type=>'internal')
    Airways.create(:airways_name =>'祥鹏',:airways_code=>'8L',:passenger_code=>'859',:airways_type=>'internal')
    Airways.create(:airways_name =>'鹰联',:airways_code=>'EU',:passenger_code=>'811',:airways_type=>'internal')
    Airways.create(:airways_name =>'西部',:airways_code=>'PN',:passenger_code=>'847',:airways_type=>'internal')
    Airways.create(:airways_name =>'华夏',:airways_code=>'G5',:passenger_code=>'987',:airways_type=>'internal')
    Airways.create(:airways_name =>'大新华快运',:airways_code=>'GS',:passenger_code=>'826',:airways_type=>'internal')
    Airways.create(:airways_name =>'东北',:airways_code=>'NS',:passenger_code=>'',:airways_type=>'internal')
    Airways.create(:airways_name =>'鲲鹏',:airways_code=>'VD',:passenger_code=>'981',:airways_type=>'internal')
    Airways.create(:airways_name =>'金鹿',:airways_code=>'JD',:passenger_code=>'898',:airways_type=>'internal')
    Airways.create(:airways_name =>'大新华航空',:airways_code=>'CN',:passenger_code=>'895',:airways_type=>'internal')
    Airways.create(:airways_name =>'美国航空',:airways_code=>'AA',:passenger_code=>'001',:airways_type=>'international')
    Airways.create(:airways_name =>'柏林航空',:airways_code=>'AB',:passenger_code=>'745',:airways_type=>'international')
    Airways.create(:airways_name =>'加拿大国际航空',:airways_code=>'AC',:passenger_code=>'014',:airways_type=>'international')
    Airways.create(:airways_name =>'墨西哥航空',   :airways_code=>'AM',:passenger_code=>'139',:airways_type=>'international')
    Airways.create(:airways_name =>'芬兰航空',     :airways_code=>'AY',:passenger_code=>'105',:airways_type=>'international')
    Airways.create(:airways_name =>'意大利航空',   :airways_code=>'AZ',:passenger_code=>'055',:airways_type=>'international')
    Airways.create(:airways_name =>'英国航空',     :airways_code=>'BA',:passenger_code=>'125',:airways_type=>'international')
    Airways.create(:airways_name =>'美国大陆航空',  :airways_code=>'CO',:passenger_code=>'005',:airways_type=>'international')
    Airways.create(:airways_name =>'国泰航空',     :airways_code=>'CX',:passenger_code=>'160',:airways_type=>'international')
    Airways.create(:airways_name =>'美国达美航空',  :airways_code=>'DL',:passenger_code=>'006',:airways_type=>'international')
    Airways.create(:airways_name =>'阿联酋航空',      :airways_code=>'EK',:passenger_code=>'176',:airways_type=>'international')
    Airways.create(:airways_name =>'埃塞俄比亚航空',:airways_code=>'ET',:passenger_code=>'071',:airways_type=>'international')
    Airways.create(:airways_name =>'阿联酋阿提哈德航空',:airways_code=>'EY',:passenger_code=>'607',:airways_type=>'international')
    Airways.create(:airways_name =>'俄罗斯国家航空',   :airways_code=>'FV',:passenger_code=>'195',:airways_type=>'international')
    Airways.create(:airways_name =>'印度尼西亚鹰航空', :airways_code=>'GA',:passenger_code=>'126',:airways_type=>'international')
    Airways.create(:airways_name =>'海湾航空',:airways_code=>'GF',:passenger_code=>'072',:airways_type=>'international')
    Airways.create(:airways_name =>'香港航空',:airways_code=>'HX',:passenger_code=>'851',:airways_type=>'international')
    Airways.create(:airways_name =>'乌兹别克斯坦航空',:airways_code=>'HY',:passenger_code=>'250',:airways_type=>'international')
    Airways.create(:airways_name =>'日本航空',:airways_code=>'JL',:passenger_code=>'131',:airways_type=>'international')
    Airways.create(:airways_name =>'潜龙航空',:airways_code=>'KA',:passenger_code=>'043',:airways_type=>'international')
    Airways.create(:airways_name =>'哈萨克斯坦阿斯塔纳航空',:airways_code=>'KC',:passenger_code=>'465',:airways_type=>'international')
    Airways.create(:airways_name =>'大韩航空',:airways_code=>'KE',:passenger_code=>'180',:airways_type=>'international')
    Airways.create(:airways_name =>'荷兰皇家航空',:airways_code=>'KL',:passenger_code=>'074',:airways_type=>'international')
    Airways.create(:airways_name =>'肯尼亚航空',:airways_code=>'KQ',:passenger_code=>'706',:airways_type=>'international')
    Airways.create(:airways_name =>'德国汉莎航空',:airways_code=>'LH',:passenger_code=>'220',:airways_type=>'international')
    Airways.create(:airways_name =>'波兰航空',:airways_code=>'LO',:passenger_code=>'080',:airways_type=>'international')
    Airways.create(:airways_name =>'瑞士国际航空',:airways_code=>'LX',:passenger_code=>'724',:airways_type=>'international')
    Airways.create(:airways_name =>'以色列航空',:airways_code=>'LY',:passenger_code=>'114',:airways_type=>'international')
    Airways.create(:airways_name =>'马来西亚航空',:airways_code=>'MH',:passenger_code=>'232',:airways_type=>'international')
    Airways.create(:airways_name =>'新加坡胜安航空',:airways_code=>'MI',:passenger_code=>'629',:airways_type=>'international')
    Airways.create(:airways_name =>'埃及航空',:airways_code=>'MS',:passenger_code=>'077',:airways_type=>'international')
    Airways.create(:airways_name =>'全日本航空',:airways_code=>'NH',:passenger_code=>'205',:airways_type=>'international')
    Airways.create(:airways_name =>'美国西北航空',:airways_code=>'NW',:passenger_code=>'012',:airways_type=>'international')
    Airways.create(:airways_name =>'澳门航空',:airways_code=>'NX',:passenger_code=>'675',:airways_type=>'international')
    Airways.create(:airways_name =>'新西兰航空',:airways_code=>'NZ',:passenger_code=>'086',:airways_type=>'international')
    Airways.create(:airways_name =>'蒙古航空',:airways_code=>'OM',:passenger_code=>'289',:airways_type=>'international')
    Airways.create(:airways_name =>'奥地利航空',:airways_code=>'OS',:passenger_code=>'257',:airways_type=>'international')
    Airways.create(:airways_name =>'韩亚航空',:airways_code=>'OZ',:passenger_code=>'988',:airways_type=>'international')
    Airways.create(:airways_name =>'曼谷航空',:airways_code=>'PG',:passenger_code=>'829',:airways_type=>'international')
    Airways.create(:airways_name =>'巴基斯坦航空',:airways_code=>'PK',:passenger_code=>'214',:airways_type=>'international')
    Airways.create(:airways_name =>'菲律宾航空',:airways_code=>'PR',:passenger_code=>'079',:airways_type=>'international')
    Airways.create(:airways_name =>'澳洲航空',:airways_code=>'QF',:passenger_code=>'081',:airways_type=>'international')
    Airways.create(:airways_name =>'卡塔尔航空',:airways_code=>'QR',:passenger_code=>'157',:airways_type=>'international')
    Airways.create(:airways_name =>'尼泊尔皇家航空',:airways_code=>'RA',:passenger_code=>'285',:airways_type=>'international')
    Airways.create(:airways_name =>'北欧航空',:airways_code=>'SK',:passenger_code=>'117',:airways_type=>'international')
    Airways.create(:airways_name =>'新加坡航空',:airways_code=>'SQ',:passenger_code=>'618',:airways_type=>'international')
    Airways.create(:airways_name =>'俄罗斯航空',:airways_code=>'SU',:passenger_code=>'555',:airways_type=>'international')
    Airways.create(:airways_name =>'西伯利亚航空',:airways_code=>'S7',:passenger_code=>'421',:airways_type=>'international')
    Airways.create(:airways_name =>'泰国航空',:airways_code=>'TG',:passenger_code=>'217',:airways_type=>'international')
    Airways.create(:airways_name =>'土耳其航空',:airways_code=>'TK',:passenger_code=>'235',:airways_type=>'international')
    Airways.create(:airways_name =>'美国联合航空',:airways_code=>'UA',:passenger_code=>'016',:airways_type=>'international')
    Airways.create(:airways_name =>'斯里兰卡航空',:airways_code=>'UL',:passenger_code=>'603',:airways_type=>'international')
    Airways.create(:airways_name =>'津巴布韦航空',:airways_code=>'UM',:passenger_code=>'168',:airways_type=>'international')
    Airways.create(:airways_name =>'俄罗斯联邦洲际航空',:airways_code=>'UN',:passenger_code=>'670',:airways_type=>'international')
    Airways.create(:airways_name =>'香港快运航空',:airways_code=>'UO',:passenger_code=>'128',:airways_type=>'international')
    Airways.create(:airways_name =>'越南航空',:airways_code=>'VN',:passenger_code=>'738',:airways_type=>'international')
    Airways.create(:airways_name =>'维珍航空',:airways_code=>'VS',:passenger_code=>'932',:airways_type=>'international')
    Airways.create(:airways_name =>'乌克兰空中世界航空',:airways_code=>'VV',:passenger_code=>'870',:airways_type=>'international')
    Airways.create(:airways_name =>'俄罗斯符拉迪沃斯托克航空',:airways_code=>'XF',:passenger_code=>'277',:airways_type=>'international')
    Airways.create(:airways_name =>'俄罗斯克拉斯诺亚尔斯克股份开放式航空公司',:airways_code=>'7B',:passenger_code=>'499',:airways_type=>'international')
    Airways.create(:airways_name =>'印度尼西亚发达飞航空',:airways_code=>'7P',:passenger_code=>'671',:airways_type=>'international')
    Airways.create(:airways_name =>'印度捷特航空',:airways_code=>'9W',:passenger_code=>'589',:airways_type=>'international')
  end
  
  def self.down
    drop_table :airways
  end
end
